import { ObjectPool } from "../../../../com/gengine/utils/pools/ObjectPool";
type int = number;
//class FlashMaskEffect
    
    export  class FlashMaskEffect
    {
        constructor()
        {
            
            this._flashMap = new Map<any, any> /* flash.utils.Dictionary */();
            return;
        }

        public regFlashMask(arg1: Object /* flash.display.DisplayObject */, arg2: Object /* flash.display.DisplayObjectContainer */, arg3: int, arg4: int): void
        {
            var loc1=null;
            if (!this._flashMap[arg1]) 
            {
                (loc1 = ObjectPool.getObject(FlashMask)).mouseChildren = false;
                loc1.mouseEnabled = false;
                this._flashMap[arg1] = loc1;
                loc1.x = arg3;
                loc1.y = arg4;
                arg2.addChild(loc1);
            }
            return;
        }

        public unRegFlashMask(arg1: Object /* flash.display.DisplayObject */): void
        {
            var loc1=null;
            if (this._flashMap[arg1]) 
            {
                loc1 = this._flashMap[arg1];
                if (loc1) 
                {
                    if (loc1.parent) 
                    {
                        loc1.parent.removeChild(loc1);
                    }
                    ObjectPool.disposeObject(loc1, FlashMask);
                }
                delete this._flashMap[arg1];
            }
            return;
        }

        public unRegAll(): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=this._flashMap;
            for (loc1 in loc4) 
            {
                loc2 = this._flashMap[loc1];
                ObjectPool.disposeObject(loc2, FlashMask);
                if (loc2.parent) 
                {
                    loc2.parent.removeChild(loc2);
                }
                delete this._flashMap[loc1];
            }
            return;
        }

        /* internal */ /* var */_flashMap: Map<any, any> /* flash.utils.Dictionary */;
    }
